﻿@{
    ViewBag.Title = "提交网站漏洞和BUG";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
    .panel-danger {
        box-shadow: deeppink 0 0 8px;
    }
    .panel-success {
        box-shadow: darkturquoise 0 0 8px;
    }
    .panel-body img{
        max-height: 80px !important;
    }
    .panel-body p{
        word-break: break-all;
    }
</style>
<script src="~/Assets/UEditor/ueditor.config.front.min.js"></script>
<script src="https://apps.bdimg.com/libs/ueditor/1.4.3.1/ueditor.all.min.js"></script>
<script src="https://cdn.bootcss.com/angular.js/1.6.6/angular.min.js"></script>
<script src="~/Scripts/tm.pagination.js"></script>
<script src="~/Scripts/layer/layer.js"></script>
<div class="container" data-ng-app="myApp" data-ng-controller="home">
    <ol class="cd-breadcrumb triangle">
        <li>@Html.ActionLink("首页", "Index", "Home")</li>
        <li class="current">
            <em>@ViewBag.Title</em>
        </li>
    </ol>
    <div>
        <div class="row">
            <div class="col-sm-6">
                <h3 class="size20" style="line-height: 46px">注意事项：</h3>
            </div>
            <div class="col-sm-6">
                <div class="btn-group pull-right">
                    <button class="btn btn-info btn-lg" type="submit" ng-click="create()">我要提交问题</button>
                </div>
            </div>
        </div>
        <ul class="list-group text-danger">
            <li class="list-group-item">1.本页面不仅仅可以提交本网站的漏洞或者BUG，也可以提交对网站的改进建议或功能完善等等；</li>
            <li class="list-group-item">2.博客文章内容相关的问题，比如链接失效之类的，请直接在文章的评论区反馈即可；</li>
            <li class="list-group-item">3.本博客项目由于是博主个人独立开发，所以漏洞和bug在所难免，而且本项目后期完善以后准备开源，所以大家尽管找bug、提bug，大家共同来完善；</li>
            <li class="list-group-item">4.您提交问题以后，博主会立即收到您的问题，会在最快的时间内修复问题；</li>
            <li class="list-group-item">5.提交后的任何问题都将会立即显示到下方的列表中，如果你发现了致命级别的一些bug，比如：密码泄露、XSS注入等，则需要当问题解决后才会显示到列表中。</li>
        </ul>
    </div>
    <div class="search-form">
        <div class="input-group">
            <input type="text" placeholder="搜索问题、BUG" class="form-control input-lg" ng-model="kw" ng-change="search(kw)">
            <div class="input-group-btn">
                <button class="btn btn-lg btn-primary" type="submit" ng-click="search(kw)">去发现</button>
            </div>
        </div>
    </div>
    <ul class="wow media-list">
        <li class="msg-list media" ng-cloak="" ng-repeat="item in Issues">
            <div class="media-body">
                <article class="panel" ng-class="{true:'panel-success',false:'panel-danger'}[item.Status=='已处理']">
                    <header class="panel-heading">
                        {{item.Name}}({{item.Email}})提交问题：{{item.Title}}【级别：{{item.Level}}】
                        <a ng-href="/bug/{{item.Id}}" class="label" ng-class="{true:'label-success',false:'label-danger'}[item.Status=='已处理']">查看详情</a>
                        <a class="label label-success" ng-if="user.IsAdmin&&item.Status=='待处理'" ng-click="handle(item.Id)">处理完成</a>
                        <a class="label label-info" ng-if="user.IsAdmin" ng-click="delete(item.Id)">删除</a>
                        <span class="pull-right hidden-sm hidden-xs" style="font-size: 14px;">
                            链接地址：
                            <a ng-href="{{item.Link}}">{{item.Link}}</a>
                        </span>
                    </header>
                    <div class="panel-body" ng-bind-html="item.Description|htmlString"></div>
                    <div class="row">
                        <div class="col-sm-4">
                            <span class="label" ng-class="{true:'label-success',false:'label-danger'}[item.Status=='已处理']">
                                <i ng-class="{true:'icon-checkmark',false:'icon-bell'}[item.Status=='已处理']"></i>
                                {{item.Status}}
                            </span>
                        </div>
                        <div class="col-sm-6 pull-right text-right" style="font-size: 8px;margin-top: 3px; margin-right: 3px">
                            <span class="text-danger">提交时间：{{item.SubmitTime|date:'yyyy-MM-dd HH:mm'}}</span>
                            <span class="text-success" ng-if="item.Status=='已处理'">
                                &nbsp;| 处理时间：{{item.HandleTime|date:'yyyy-MM-dd HH:mm'}}
                            </span>
                        </div>
                    </div>
                </article>
            </div>
        </li>
    </ul>
    <tm-pagination conf="paginationConf"></tm-pagination>
    <h2 class="size24 text-primary" ng-if="conf.totalItems <= 0">如此完美？居然没有BUG！！！</h2>
    <div style="position: fixed; left: -20000px; bottom: -20000px;">
        <div id="bug-form" class="container-fluid">
            <form class="form-horizontal margin-top10 margin-bot10" method="post" id="form">
                @Html.AntiForgeryToken()
                <div class="input-group">
                    <span class="input-group-addon">
                        <label for="name">昵称：</label>
                    </span>
                    <input type="text" class="form-control" ng-model="Issue.Name" id="name" required placeholder="昵称" maxlength="16">
                </div>
                <div class="input-group">
                    <span class="input-group-addon">
                        <label for="email">邮箱：</label>
                    </span>
                    <input type="email" class="form-control" ng-model="Issue.Email" id="email" required placeholder="留下您的真实邮箱，以方便接收回复" maxlength="128">
                </div>
                <div class="input-group">
                    <span class="input-group-addon">
                        <label for="title">主题：</label>
                    </span>
                    <input type="text" class="form-control" ng-model="Issue.Title" id="title" required placeholder="是什么问题" maxlength="32">
                </div>
                <div class="input-group">
                    <span class="input-group-addon">
                        <label for="link">链接：</label>
                    </span>
                    <input type="text" class="form-control" ng-model="Issue.Link" id="link" required placeholder="哪个地址出了问题，贴到这里来" maxlength="256">
                </div>
                <div class="input-group">
                    <span class="input-group-addon">
                        <label for="link">BUG级别：</label>
                    </span>
                    <select class="form-control" ng-model="Issue.Level" ng-options="m.value as m.name for m in BugLevels">
                        <option value="">请选择BUG级别</option>
                    </select>
                </div>
                <div class="form-group margin-clear margin-top10">
                    <h3 class="size18">问题的详细描述：</h3>
                    <textarea id="editor" style="height:300px;" class="ueditor" ng-model="Issue.Description" type="text/plain"></textarea>
                </div>
                <div class="btn-group">
                    <button type="button" class="btn btn-info" ng-click="submit(Issue)">
                        提交
                    </button>
                    <button type="button" class="btn btn-danger" ng-click="cancel()">
                        取消
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="~/Scripts/apps/app.bug.min.js"></script>